function(http_layer_find_libevent)
	if (TARGET http_layer_libevent_internal)
		return()
	endif ()

	if(WIN32)
		find_path(LIBEVENT_INCLUDE_DIR event.h ${HTTPLAYER_3RD_OUTDIR}/libevent-2.1.12/include)
		find_library(LIBEVENT_LIBRARY NAMES event.lib PATHS ${HTTPLAYER_3RD_OUTDIR}/libevent-2.1.12/lib)
	else()
		find_path(LIBEVENT_INCLUDE_DIR event.h ${HTTPLAYER_3RD_OUTDIR}/libevent-2.1.12/include)
		find_library(LIBEVENT_LIBRARY NAMES libevent.a PATHS ${HTTPLAYER_3RD_OUTDIR}/libevent-2.1.12/lib NO_DEFAULT_PATH)
		find_library(LIBEVENT_LIBRARY_PTHREADS NAMES libevent_pthreads.a PATHS ${HTTPLAYER_3RD_OUTDIR}/libevent-2.1.12/lib NO_DEFAULT_PATH)
	endif()

	include(FindPackageHandleStandardArgs)
	find_package_handle_standard_args(LIBEVENT DEFAULT_MSG LIBEVENT_LIBRARY LIBEVENT_INCLUDE_DIR)

	add_library(http_layer_libevent_internal INTERFACE)
	target_include_directories(http_layer_libevent_internal INTERFACE "$<BUILD_INTERFACE:${LIBEVENT_INCLUDE_DIR}>")
	target_link_libraries(http_layer_libevent_internal INTERFACE
		${LIBEVENT_LIBRARY}
		${LIBEVENT_LIBRARY_PTHREADS}
	)
endfunction()